1. Field of the Invention
The invention relates to a fixing mechanism and an electronic device having the same, and more particularly to a fixing mechanism for fixing a magnetic element on a base wall and an electronic device having the same.
2. Description of the Related Art
In a magnet fixing structure and a notebook computer disclosed in Taiwanese Patent No. M348452, the magnet fixing structure includes a base wall, two opposite first lateral walls having bottom ends connected to the base wall, and a second lateral wall having a bottom end connected to the base wall and two opposite lateral ends connected respectively to one lateral ends of the first lateral walls. The first and second lateral walls cooperatively define a receiving space for receiving a magnet. An inverted U-shaped wall has two opposite ends connected to the base wall, and includes two opposite arms connected respectively to the other lateral ends of the first lateral walls. The inverted U-shaped wall defines an entry hole for entrance of the magnet into the receiving space. When the magnet is inserted into the receiving space via the entry hole, one of the first lateral walls deforms resiliently and cooperates with the other first lateral wall to clamp therebetween the magnet.
However, because only the first lateral walls cooperatively clamp therebetween the magnet, if the notebook computer falls down accidentally or receives an external impact, the magnet is easily detached from the clamping of the first lateral walls, and moves out of the receiving space via the entry hole. Thus, the aforesaid magnet fixing structure cannot stably fix the magnet.